#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <bitset>
#include <utility>
using namespace std;

#define mm(a, n) memset(a, n, sizeof a)
#define mk(a, b) make_pair(a, b)

const double eps = 1e-6;
const int INF = 0x3f3f3f3f;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<int, LL> PIL;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

const int N = 510;

struct Station {
    double price, distance;

    bool operator< (const Station & s) const {
        return distance < s.distance;
    }
}st[N];

int Cmax, D, Davg, n;

inline void solution() {
    cin >> Cmax >> D >> Davg >> n;
    
    for (int i = 0; i < n; i ++ ) 
        cin >> st[i].price >> st[i].distance;
    st[n] = {0, (double)D};
    sort(st, st + n + 1);
    if (st[0].distance) {
        cout << "The maximum travel distance = 0.00" << endl;
        return ;
    }
    double res = 0, oil = 0;
    for (int i = 0; i < n; ) {
        int k = -1;
        for (int j = i + 1; j <= n && st[j].distance - st[i].distance <= Cmax * Davg; j ++ ) {
            if (st[j].price < st[i].price) {k = j; break;}
            else if (k == -1 || st[j].price < st[k].price)
                k = j;
        }

        if (k == -1) {
            printf("The maximum travel distance = %.2lf\n", st[i].distance + Cmax * Davg);
            return ;
        }

        if (st[k].price <= st[i].price) {
            res += ((st[k].distance - st[i].distance) / Davg - oil) * st[i].price;
            oil = 0;
        } else {
            res += (Cmax - oil) * st[i].price;
            oil = Cmax - (st[k].distance - st[i].distance) / Davg;
        }
        i = k;
    }

    printf("%.2lf\n", res);
    return ;
}

int main() {
    freopen("input.txt", "r", stdin);
    quickread();
    solution();
    return 0;
}